from tortoise import fields, models

class Battery(models.Model):
    battery_id = fields.IntField(pk=True)
    battery_name = fields.CharField(max_length=100)
    max_output_power = fields.DecimalField(max_digits=10, decimal_places=4, description="最大输出功率")
    max_input_power = fields.DecimalField(max_digits=10, decimal_places=4, description="最大输入功率")
    capacity = fields.DecimalField(max_digits=10, decimal_places=4, description="电池容量")
    initial_capacity = fields.DecimalField(max_digits=10, decimal_places=4, description="初始容量")
    icon = fields.TextField(description="电池图标")
    background = fields.CharField(max_length=100, description="背景")

    class Meta:
        table = "battery"

    def __str__(self):
        return self.battery_name